/**
 * 
 */
package org.example.dao.impl;

import java.util.List;

import org.example.dao.BaseDao;
import org.example.dao.WechatDao;
import org.example.pojo.Wechat;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @author alex
 *
 */
@Repository
public class WechatDaoImpl extends BaseDao implements WechatDao{
	@Autowired
	public void setSessionFactory0(SessionFactory sessionFactory){
	     super.setSessionFactory(sessionFactory);
	}
	@SuppressWarnings("unchecked")
	@Override
	public List<Wechat> selectWechatById(String id) {
			DetachedCriteria dc = DetachedCriteria.forClass(Wechat.class);
			dc.add(Restrictions.eq("id", Integer.parseInt(id)));
			return (List<Wechat>) this.getHibernateTemplate().findByCriteria(dc);
		}

}
